<?php
    // estilos -- ver por qué no puedo usar class con un css - otra clase debe estar bloqueandolo
    $tabla_orga_td = 'vertical-align: middle; background-color: ; border: none;';    

    // imagenes
    $prev_img = $this->Html->image("restaurante/ic_navegar_left.png", array("width" => "32px", "height" => "32px", "id" => "nav_icon_left"));    
    $next_img = $this->Html->image("restaurante/ic_navegar.png", array("width" => "32px", "height" => "32px", "id" => "nav_icon_right"));    
    $prev_img_disabled = $this->Html->image("restaurante/ic_nav_left_disabled.png", array("width" => "32px", "height" => "32px", "id" => "nav_icon_left_disabled"));    
    $next_img_disabled = $this->Html->image("restaurante/ic_navegar_disabled.png", array("width" => "32px", "height" => "32px", "id" => "nav_icon_right_disabled"));    


    $volver_img = $this->Html->image("restaurante/ic_back.png", array("id" => "back_icon"));    
    $nuevo_img = $this->Html->image("restaurante/ic_add.png", array("id" => "add_icon"));    
    $cancel_img = $this->Html->image("restaurante/ic_cancel.png", array("id" => "back_icon"));    
    $save_img = $this->Html->image("restaurante/ic_ok.png", array("id" => "save_icon"));    
    
    $editar_img = $this->Html->image("restaurante/doc_images.png", array("width" => "24px", "height" => "24px"));    
    
?>


  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  
<script type="text/javascript">
$(document).ready(function() {
        $('.datepicker').datepicker({
        format: "dd-mm-yyyy",
        todayBtn: "linked",
        orientation: "bottom right",
        autoclose: true,
        todayHighlight: true
    });
});
</script>


<!--- MARCO DE LA PANTALLA ------>
<table><tr><td style="width: 25%; border: none;"></td>
        <td style="padding: 20px; background: white;<?php echo $tabla_orga_td;?>">

<table>
    <tr>
        <td style="width: 15%; text-align:right; <?php echo $tabla_orga_td;?>"><div><?php echo $this->Html->image("restaurante/ic_resto.png", array("id" => "resto_icon"));?></div></td>
        <td style="width: 55%; text-align:left; <?php echo $tabla_orga_td;?>"><h1 class="titulo_ventana_2">Editar descuento</h1></td>
        <td style="width: 30%; text-align:right; <?php echo $tabla_orga_td;?>">
            <table>
                <tr><td style="text-align:right; <?php echo $tabla_orga_td;?>"><?php echo 'Usuario: '.$nombre_usuario;?></td></tr>
                <tr><td style="text-align:right; <?php echo $tabla_orga_td;?>"><?php echo $this->Html->link('Cerrar sesión', array("controller"=>"users", "action"=>"logout"), array('title' => 'Cerrar sesión', 'escape' => false));?></td></tr>
            </table>
        </td>
    </tr>      
</table>
<hr>

<?php echo $this->Form->create('Descuento'); ?>

<table style="<?php echo $tabla_orga_td;?>">
    <tr style="<?php echo $tabla_orga_td;?>">
        <td style="width:40%; <?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('codigo', array('label' => 'Código')); ?></td>
        <td style="width:20%;vertical-align: middle; <?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('activo', array('checked' => true, 'label' => 'Activo')); ?></td>     
    </tr>
    <tr style="<?php echo $tabla_orga_td;?>">
        <td style="width:50%; <?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('titulo', array('label' => 'Título')); ?></td>
        <td style="width:50%;<?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('porcentaje',array('label' => 'Porcentaje [%]','options' => array('5','10','15','20','25','30','35','40','45','50','55','60','65','70','75','80','85','90','95','100'))); ?></td>
    </tr>
    <tr style="<?php echo $tabla_orga_td;?>">                 
        <td style="width:40%; <?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('fecha_desde', array('class' => 'form-control datepicker','type' => 'text', 'readonly' => 'readonly'));?>
        
        <td style="width:40%; <?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('fecha_hasta', array('class' => 'form-control datepicker','type' => 'text', 'readonly' => 'readonly'));?>  
    </tr>
    <tr style="<?php echo $tabla_orga_td;?>"><td colspan="2" style="width:100%;<?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('descripcion', array('label' => 'Descripción')); ?></td></tr>
</table>

<table>
    <tr>
        <td style="width: 10%; text-align:right; <?php echo $tabla_orga_td;?>"><?php echo 'Cancelar'; ?></td>
        <td style="width: 10%; text-align:left; <?php echo $tabla_orga_td;?>"><?php echo $this->Html->link($cancel_img, array("controller"=>"descuentos", "action"=>"index"), array('class' => 'button', 'title' => 'Cancelar', 'escape' => false));?></td>
        <td style="width: 60%; <?php echo $tabla_orga_td;?>"></td>
        <td style="width: 10%; text-align:right; <?php echo $tabla_orga_td;?>"><?php echo 'Guardar'; ?></td>
        <td style="width: 10%; text-align:left; <?php echo $tabla_orga_td;?>"><?php echo $this->Form->submit('restaurante/ic_ok.png', array('style' => 'width:inherit;')); ?> </td>

    </tr>
</table>


<?php echo $this->Form->end(); ?>

<!--- FIN MARCO DE LA PANTALLA ------>
</td><td style="width: 25%; border: none;"></tr></table>